Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

surface better error messages #35

Open
WayneCui opened this issue Apr 18, 2023 · 4 comments
Open

surface better error messages #35

WayneCui opened this issue Apr 18, 2023 · 4 comments
Assignees

Comments

@bo-ku-ra
Copy link

cause
shape: sequence_diagram

@alixander
Copy link
Contributor

it should still work with sequence_diagram though. we'll look into it

@ejulio-ts
Copy link

@WayneCui you are missing an entry for forend. As far as I remember, we don't allow defining nested actors, they must be defined upfront, to avoid ambiguity. So, just adding frond: something below should compile

config: 客户端解决方案时序图 {
  shape: sequence_diagram
  client: 客户
  agg: C端聚合页
  clear: 澄清页
  solution: 解决方案页
  backend: 后端服务
  mysql: MySQL
  mongo: MongoDB
  lore: 知识库服务

here is where you use it

新增规则解决方案: {
      client -> forend: 新增规则按钮,输入规则条件,添加解决方案内容
      forend -> client: 【新tab】\n返回方案编辑页面
      client -> forend: 拖动编辑解决方案并保存
      forend -> backend: 保存解决方案
      backend -> mysql: 解决方案入库
      mysql -> backend: 返回规则解决方案编码
      backend -> forend: 返回规则解决方案编码
      forend -> client: 保存成功,页面自动关闭
    }

@ejulio-ts
Copy link

Anyway, I think our playground message could be better
image

While the console output was

err: failed to compile: could not find center of forend. Is it declared as an actor?
exit status 1

@alixander alixander changed the title Can't compile in the playground suddenly surface better error messages Apr 28, 2023
@alixander alixander transferred this issue from terrastruct/d2 Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

4 participants